home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #3
/
Amiga Plus CD - 1997 - No. 03.iso
/
pd
/
demo-versionen
/
maxoncpp4-demo
/
demo
/
supercode
/
strings.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-12-31
|
740b
|
46 lines
//-------------------------------------
//
// SuperCode (c) 1996 by T.Kühn
//
// Programmiersprache: ANSI-C
// Projektstart: 27.12.94
//
// Modul: Strings
//
//-------------------------------------
#include <Struct.h>
//-------------------------------------
UBYTE *StrCopy(UBYTE *dest, UBYTE *src, ULONG max)
{
register UBYTE *t1=src;
register UBYTE *t2=dest;
while(max>0 && t1[0]!=0)
{
t2++[0]=t1++[0];
max--;
}
if (max>0) t2[0]=0;
return t2;
}
//-------------------------------------
UBYTE *StrAdd(UBYTE *dest, UBYTE *src, ULONG max)
{
LONG len=strlen(dest);
UBYTE *back=0;
if (len<max)
{
back=StrCopy(&dest[len],src,max-len);
}
else back=dest+max;
return back;
}
//-------------------------------------